package cn.com.utt.common.service.impl;

import org.springframework.stereotype.Service;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import cn.com.utt.common.service.SmsService;
import cn.com.utt.common.sms.zt.SmsSend;

@Service("smsService")
public class SmsServiceImpl implements SmsService{
	
	public int sendSmsResponse(String phone,String code,String jsonContent,String signature){
		try {
			SendSmsResponse sendSmsResponse = SmsSend.sendSms(phone, code,jsonContent, signature);
			if(sendSmsResponse.getCode()!=null&& sendSmsResponse.getCode().equals("OK")){
				return 1;//发送成功
			}
		} catch (ClientException e) {
			return 0;
		}
		return 0;
	}
}